import { createRouter, createWebHistory,createWebHashHistory } from 'vue-router'  
import Home from '@/views/Home.vue'  
import About from '@/views/About.vue' 
import goodDetail from '@/views/goodDetail' 

  
// 定义路由配置  
const routes = [  
  {  
    path: '/',  
    name: 'Home',  
    component: Home,  
  }, 
  { path:'/goodDetail/:id',
    name:"goodDetail",
    component: goodDetail,  
  },
  {  
    path: '/about',  
    name: 'About',  
    component: About  
  }, 
  // 其他路由配置...  
]  
  
// 创建路由实例  
const router = createRouter({  
  // history: createWebHistory(process.env.BASE_URL),
  history: createWebHashHistory(process.env.BASE_URL), // 修改后  
  routes, // 简写，等价于 routes: routes  
})  
  
export default router